﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="Add-Filter.aspx.cs" Inherits="Add_Filter" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
     <link href="css/style-metro.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <asp:UpdatePanel runat="server" ID="upFilter">
        <ContentTemplate>
            <div>
                <h4 class="heading">
                    <asp:Label runat="server" CssClass="Header" ID="lblHeader" Text="Add/Edit Category"></asp:Label></h4>
                <div id="divMessage" runat="server">
                </div>
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" CssClass="alert alert-danger"
                    ValidationGroup="save" />
                <div>
                    <div>
                        <div class="leftClass">
                            <label>
                                <span class="Required">* </span>Filter Name</label>
                        </div>
                        <div class="rightClass">
                            <asp:TextBox runat="server" ID="txtFilterName" CssClass="width validate[required]"></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtFilterName"
                                ErrorMessage="Please Enter Filter Name" CssClass="Required" ValidationGroup="save">*</asp:RequiredFieldValidator>
                            <asp:Button runat="server" ID="btnsave" Text="Save" CssClass="Button" ValidationGroup="save"
                                OnClick="Save" />
                            <asp:Button runat="server" ID="btnCancel" Text="Cancel" CssClass="cancel" OnClick="OnCancel" />
                        </div>
                        <div class="rightClass">
                        </div>
                    </div>
                </div>
                <div align="center">
                </div>
            </div>
            <div class="portlet box green listmarging">
                <div class="portlet-title">
                    <div class="caption">
                        <i class="icon-globe"></i>Filter List</div>
                    <div class="actions">
                        <div class="btn-group">
                            <a class="btn" href="#" data-toggle="dropdown">Columns <i class="icon-angle-down"></i>
                            </a>
                            <div id="sample_2_column_toggler" class="dropdown-menu hold-on-click dropdown-checkboxes pull-right">
                                <label>
                                    <input type="checkbox" checked data-column="0">Name</label>
                                <label>
                                    <input type="checkbox" checked data-column="1">Action/label>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="portlet-body ">
                    <div id="divListmsg" runat="server">
                    </div>
                    <table class="table table-striped table-bordered table-hover table-full-width" id="sample_2">
                        <thead>
                            <tr>
                                <th>
                                    Name
                                </th>
                                <th class="hidden-480">
                                    Action
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <asp:Repeater ID="rptFilter" runat="server" OnItemCommand="ItemCommand">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:Label runat="server" ID="lblName" Text='<%# Eval("Name") %>' Width="150px"></asp:Label>
                                            <asp:LinkButton ID="lnkEdit" runat="server" CommandArgument='<%#Eval("id") %>' Style="margin-left: 15px;"
                                                CommandName="Edit">Edit</asp:LinkButton>
                                            <asp:TextBox ID="txtName" runat="server" Text='<%#Eval("Name") %>' Visible="false"></asp:TextBox>
                                        </td>
                                        <td>
                                            <center>
                                                <%--<a href='Add-Filter.aspx?Id=<%# Eval("Id") %>' title="Edit" class="with-tip">
                                            <img src="img/pencil.png" width="16" height="16" alt="Edit"></a>--%>
                                                <asp:HiddenField runat="server" ID="hdf" Value='<%# Eval("name") %>' />
                                                <asp:LinkButton runat="server" ID="lnkDelete" OnClientClick="callAlert(this);return false;"
                                                    CommandName="Delete" CommandArgument='<%# Eval("Id") %>' Text="delete">
                                              <img src="img/cross-circle.png" width="16" height="16" alt="Delete">
                                                </asp:LinkButton>
                                                <asp:LinkButton ID="lnkUpdate" runat="server" CommandArgument='<%#Eval("id") %>'
                                                    CommandName="update" Visible="false">Update</asp:LinkButton>
                                                <asp:LinkButton ID="lnkCancel" runat="server" CommandArgument='<%#Eval("id") %>'
                                                    CommandName="cancel" Visible="false">Cancel</asp:LinkButton>
                                            </center>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </tbody>
                    </table>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
